

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Fly542">
  <meta name="keywords" content="">
  
    <meta name="description" content="检测方法如何定位分析程序中当前内存使用情况，可通过外部和内部两种方式来确定内存相关情况， 外部字段分析只要知道进程的pid 即可通过命令 &#x2F;proc&#x2F;xxxx&#x2F;satatus 来查看内存信息。其中xxxx为pid号. 显示的各个字段含义如下: 12345678910111213VmPeak: 代表当前进程运行过程中虚拟内存的峰值。VmSize: 代表进程现在正在占用的虚拟内存。VmLck: 代表进">
<meta property="og:type" content="article">
<meta property="og:title" content="内存管理与分析">
<meta property="og:url" content="http://fly542.cn/2022/07/22/03%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91/01c_cpp/15%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86%E4%B8%8E%E5%88%86%E6%9E%90/index.html">
<meta property="og:site_name" content="Fly542 技术沉淀">
<meta property="og:description" content="检测方法如何定位分析程序中当前内存使用情况，可通过外部和内部两种方式来确定内存相关情况， 外部字段分析只要知道进程的pid 即可通过命令 &#x2F;proc&#x2F;xxxx&#x2F;satatus 来查看内存信息。其中xxxx为pid号. 显示的各个字段含义如下: 12345678910111213VmPeak: 代表当前进程运行过程中虚拟内存的峰值。VmSize: 代表进程现在正在占用的虚拟内存。VmLck: 代表进">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2022-07-22T03:29:45.000Z">
<meta property="article:modified_time" content="2022-12-30T03:33:01.358Z">
<meta property="article:author" content="Fly542">
<meta property="article:tag" content="c++">
<meta property="article:tag" content="c">
<meta name="twitter:card" content="summary_large_image">
  
  
  <title>内存管理与分析 - Fly542 技术沉淀</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hint.css@2/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/github-gist.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"fly542.cn","root":"/","version":"1.8.14","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 6.0.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Fly542 技术沉淀</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="内存管理与分析">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2022-07-22 11:29" pubdate>
        2022年7月22日 上午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      3.2k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      27 分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">内存管理与分析</h1>
            
            <div class="markdown-body">
              <h1 id="检测方法"><a href="#检测方法" class="headerlink" title="检测方法"></a>检测方法</h1><p>如何定位分析程序中当前内存使用情况，可通过外部和内部两种方式来确定内存相关情况，</p>
<h2 id="外部字段分析"><a href="#外部字段分析" class="headerlink" title="外部字段分析"></a>外部字段分析</h2><p>只要知道进程的pid 即可通过命令 <code>/proc/xxxx/satatus</code> 来查看内存信息。其中xxxx为pid号.</p>
<p>显示的各个字段含义如下:</p>
<figure class="highlight avrasm"><table><tr><td class="gutter"><div class="code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></div></td><td class="code"><pre><code class="hljs avrasm"><span class="hljs-symbol">VmPeak:</span> 代表当前进程运行过程中虚拟内存的峰值。<br><span class="hljs-symbol">VmSize:</span> 代表进程现在正在占用的虚拟内存。<br><span class="hljs-symbol">VmLck:</span> 代表进程已经锁住的物理内存的大小，锁住的物理内存不能交换到硬盘。<br><span class="hljs-symbol">VmPin:</span> 进程中被pin住的虚拟内存大小。<br><span class="hljs-symbol">VmHWM:</span> 进程得到分配的物理内存的峰值，应该是到目前为止的VmRSS的最大值。<br><span class="hljs-symbol">VmRSS:</span> 进程现在使用的物理内存。<br><span class="hljs-symbol">RssAnon:</span> 进程占用的物理内存中的匿名部分的大小，可以理解为RSS中除去RssFile和RssFile占用的部分。<br><span class="hljs-symbol">RssFile:</span> 进程占用的物理内存中用于文件映射的部分的大小。<br><span class="hljs-symbol">RssShmem:</span> 进程占用的物理内存中共享内存的部分的大小。<br><span class="hljs-symbol">VmData:</span> 表示进程虚拟内存中的数据段的大小。<br><span class="hljs-symbol">VmStk:</span> 表示进程虚拟内存中的堆栈段的大小。<br><span class="hljs-symbol">VmExe:</span> 表示进程虚拟内存中的代码段的大小<br><span class="hljs-symbol">VmSwap:</span> 进程占用<span class="hljs-keyword">Swap</span>的大小。<br></code></pre></td></tr></table></figure>
<h2 id="内部定期输出"><a href="#内部定期输出" class="headerlink" title="内部定期输出"></a>内部定期输出</h2><p>增加以下函数可以输出程序运行中当前内存的使用情况</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><code class="hljs cpp"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;malloc.h&gt;</span>   <span class="hljs-comment">// mallinfo及malloc_stats依赖</span></span><br><br><span class="hljs-function"><span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">display_mallinfo</span><span class="hljs-params">(<span class="hljs-keyword">int</span> seq)</span> </span>&#123;<br>    <span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">mallinfo</span> <span class="hljs-title">mi</span>;</span><br>    mi = <span class="hljs-built_in">mallinfo</span>();<br>    std::stringstream ss;<br><br>    ss &lt;&lt; <span class="hljs-string">&quot;*************************** &quot;</span> &lt;&lt; seq;<br>    ss &lt;&lt; <span class="hljs-string">&quot;\nTotal non-mmapped bytes (arena):       &quot;</span> &lt;&lt; mi.arena;<br>    ss &lt;&lt; <span class="hljs-string">&quot;\n# of free chunks (ordblks):            &quot;</span> &lt;&lt; mi.ordblks;<br>    ss &lt;&lt; <span class="hljs-string">&quot;\n# of free fastbin blocks (smblks):     &quot;</span> &lt;&lt; mi.smblks;<br>    ss &lt;&lt; <span class="hljs-string">&quot;\n# of mapped regions (hblks):           &quot;</span> &lt;&lt; mi.hblks;<br>    ss &lt;&lt; <span class="hljs-string">&quot;\nBytes in mapped regions (hblkhd):      &quot;</span> &lt;&lt; mi.hblkhd;<br>    ss &lt;&lt; <span class="hljs-string">&quot;\nMax. total allocated space (usmblks):  &quot;</span> &lt;&lt; mi.usmblks;<br>    ss &lt;&lt; <span class="hljs-string">&quot;\nFree bytes held in fastbins (fsmblks): &quot;</span> &lt;&lt; mi.fsmblks;<br>    ss &lt;&lt; <span class="hljs-string">&quot;\nTotal allocated space (uordblks):      &quot;</span> &lt;&lt; mi.uordblks;<br>    ss &lt;&lt; <span class="hljs-string">&quot;\nTotal free space (fordblks):           &quot;</span> &lt;&lt; mi.fordblks;<br>    ss &lt;&lt; <span class="hljs-string">&quot;\nTopmost releasable block (keepcost):   &quot;</span> &lt;&lt; mi.keepcost;<br><br>    <span class="hljs-built_in">fprintf</span>(stderr, <span class="hljs-string">&quot;--------------------stats info(%d)---------\n&quot;</span>, seq);<br>    <span class="hljs-built_in">malloc_stats</span>();<br>    <span class="hljs-built_in">fprintf</span>(stderr, <span class="hljs-string">&quot;%s\n&quot;</span>, ss.<span class="hljs-built_in">str</span>().<span class="hljs-built_in">c_str</span>());<br>&#125;<br><br></code></pre></td></tr></table></figure>


<p>结果分析</p>
<figure class="highlight livecodeserver"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><code class="hljs livecodeserver"><br><span class="hljs-comment">--------------------stats info(0)---------</span><br>Arena <span class="hljs-number">0</span>:                                           <span class="hljs-comment"># 非mmap申请的内存区域 0 </span><br><span class="hljs-keyword">system</span> <span class="hljs-keyword">bytes</span>     =   <span class="hljs-number">59752448</span>                      <span class="hljs-comment"># glibc 向系统申请的内存大小, 单位字节                      </span><br><span class="hljs-keyword">in</span> use <span class="hljs-keyword">bytes</span>     =   <span class="hljs-number">27787856</span>                      <span class="hljs-comment"># 用户进程通过 malloc 向 glibc 申请分配的内存大小</span><br>Arena <span class="hljs-number">1</span>:                                           <span class="hljs-comment"># 非mmap申请的内存区域 1</span><br><span class="hljs-keyword">system</span> <span class="hljs-keyword">bytes</span>     =     <span class="hljs-number">135168</span><br><span class="hljs-keyword">in</span> use <span class="hljs-keyword">bytes</span>     =       <span class="hljs-number">7504</span><br>Total (incl. mmap):                                <span class="hljs-comment"># 所有内存信息(包含mmap),各个arena数值加上mmap信息</span><br><span class="hljs-keyword">system</span> <span class="hljs-keyword">bytes</span>     =   <span class="hljs-number">63369216</span>                      <span class="hljs-comment"># 包含mmap的所有内存大小, 由mmap+各个Arena累计获取</span><br><span class="hljs-keyword">in</span> use <span class="hljs-keyword">bytes</span>     =   <span class="hljs-number">31276960</span>                      <span class="hljs-comment"># 用户进程通过 malloc 向 glibc 申请分配的内存大小，由各个Arena累加获得</span><br><span class="hljs-built_in">max</span> mmap regions =          <span class="hljs-number">6</span>                      <span class="hljs-comment"># mmap 区域个数</span><br><span class="hljs-built_in">max</span> mmap <span class="hljs-keyword">bytes</span>   =    <span class="hljs-number">3481600</span>                      <span class="hljs-comment"># mmap 申请的内存字节数</span><br><br>*************************** <span class="hljs-number">0</span><br>Total non-mmapped <span class="hljs-keyword">bytes</span> (arena):       <span class="hljs-number">59887616</span>    <span class="hljs-comment"># 非mmap申请的内存字节数,等于stats info中所有的Arean的system bytes计数和(内存分配区域),包含正在使用的和空闲的</span><br><span class="hljs-comment"># of free chunks (ordblks):            12549       # 普通(即非fastbin)空闲块的数量</span><br><span class="hljs-comment"># of free fastbin blocks (smblks):     6           # fastbin空闲块的数量                                    </span><br><span class="hljs-comment"># of mapped regions (hblks):           6           # 当前使用mmap分配的块数                                    </span><br>Bytes <span class="hljs-keyword">in</span> mapped regions (hblkhd):      <span class="hljs-number">3481600</span>     <span class="hljs-comment"># 当前使用mmap分配的块中的字节数</span><br>Max. total allocated <span class="hljs-literal">space</span> (usmblks):  <span class="hljs-number">0</span>           <span class="hljs-comment"># 该字段未使用,始终为0。以前代表已分配最大空间(以字节为单位)。</span><br>Free <span class="hljs-keyword">bytes</span> held <span class="hljs-keyword">in</span> fastbins (fsmblks): <span class="hljs-number">592</span>         <span class="hljs-comment"># fastbin空闲块中的字节总数</span><br>Total allocated <span class="hljs-literal">space</span> (uordblks):      <span class="hljs-number">27794800</span>    <span class="hljs-comment"># 使用中的分配所使用的字节总数</span><br>Total free <span class="hljs-literal">space</span> (fordblks):           <span class="hljs-number">32092816</span>    <span class="hljs-comment"># 空闲块中的字节总数</span><br>Topmost releasable block (keepcost):   <span class="hljs-number">4016</span>        <span class="hljs-comment"># 堆顶部的可释放可用空间总量。这是malloc_trim理想情况下可以释放的最大字节数(即:忽略页面对齐限制等)</span><br></code></pre></td></tr></table></figure>

<h1 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h1><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs awk">https:<span class="hljs-regexp">//m</span>an7.org<span class="hljs-regexp">/linux/m</span>an-pages<span class="hljs-regexp">/man3/m</span>allinfo.<span class="hljs-number">3</span>.html<br>https:<span class="hljs-regexp">//</span>www.onitroad.com<span class="hljs-regexp">/jc/</span>linux<span class="hljs-regexp">/man-pages/</span>linux<span class="hljs-regexp">/man3/m</span>allinfo.<span class="hljs-number">3</span>.html<br>https:<span class="hljs-regexp">//</span>www.cnblogs.com<span class="hljs-regexp">/dongzhiquan/</span>p/<span class="hljs-number">5621906</span>.html<br>https:<span class="hljs-regexp">//</span>www.onitroad.com<span class="hljs-regexp">/jc/</span>linux<span class="hljs-regexp">/man-pages/</span>linux<span class="hljs-regexp">/man3/m</span>alloc_trim.<span class="hljs-number">3</span>.html<br>http:<span class="hljs-regexp">//</span>www.xtaohub.com<span class="hljs-regexp">/System-Microscope/</span>how-to-use-memory.html<br>https:<span class="hljs-regexp">//</span>wenfh2020.com<span class="hljs-regexp">/2021/</span><span class="hljs-number">04</span><span class="hljs-regexp">/08/g</span>libc-memory-leak/<br>https:<span class="hljs-regexp">//</span>blog.csdn.net<span class="hljs-regexp">/weixin_39636610/</span>article<span class="hljs-regexp">/details/</span><span class="hljs-number">113053005</span><br>https:<span class="hljs-regexp">//</span>www.modb.pro<span class="hljs-regexp">/db/</span><span class="hljs-number">237286</span><br></code></pre></td></tr></table></figure>
            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/devops/">devops</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/c/">c++</a>
                    
                      <a class="hover-with-bg" href="/tags/c/">c</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2022/08/04/04DevOps/17curl%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">curl常用方法</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2022/05/24/03%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91/01c_cpp/14pem%E6%A0%BC%E5%BC%8F%E5%85%AC%E9%92%A5%E7%A7%81%E9%92%A5%E6%96%87%E4%BB%B6%E5%AE%9E%E7%8E%B0RSA%E5%8A%A0%E8%A7%A3%E5%AF%86/">
                        <span class="hidden-mobile">openssl生成pem格式公钥私钥文件并实现RSA加解密</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  

  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  






  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
        typing(title);
      
    })(window, document);
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
